const throttle = {
  mounted(el, binding) {
    let lastExecTime = 0
    const delay = Number(binding.arg) || 1000
    const handler = binding.value
    el.addEventListener('click', () => {
      const now = Date.now()
      if (now - lastExecTime >= delay) {
        handler()
        lastExecTime = now
      }
    })
  }
}
export default throttle